#ifndef _WINDOW_CH
#define _WINDOW_CH

#xcommand DEFINE WINDOW <oWnd> ;
             [ FROM <nTop>, <nLeft> TO <nBottom>, <nRight> ] ;
             [ TITLE <cTitle> ] ;
             [ STYLE <nStyle> ] ;
             [ MENU <oMenu> ] ;
             [ MDI ] ;
       => ;
          <oWnd> := TMdiFrame():New( <nTop>, <nLeft>, <nBottom>, <nRight>,;
                                     <cTitle>, <nStyle>, <oMenu> )

#xcommand DEFINE WINDOW <oWnd> ;
             [ FROM <nTop>, <nLeft> TO <nBottom>, <nRight> ] ;
             [ TITLE <cTitle> ] ;
             [ STYLE <nStyle> ] ;
             [ MENU <oMenu> ] ;
             [ OF <oParent> ] ;
       => ;
          <oWnd> := TWindow():New( <nTop>, <nLeft>, <nBottom>, <nRight>,;
                                   <cTitle>, <nStyle>, <oMenu>, <oParent> )

#xcommand ACTIVATE WINDOW <oWnd> ;
             [ <show: ICONIZED, NORMAL, MAXIMIZED> ] ;
             [ ON LEFT CLICK <uLClick> ] ;
             [ ON RIGHT CLICK <uRClick> ] ;
             [ ON MOVE <uMove> ] ;
             [ ON RESIZE <uResize> ] ;
             [ ON PAINT <uPaint> ] ;
             [ ON KEYDOWN <uKeyDown> ] ;
             [ ON INIT <uInit> ] ;
       => ;
          <oWnd>:Activate( [ Upper(<(show)>) ],;
                           <oWnd>:bLClicked [ := \{ |nRow,nCol,nKeyFlags| <uLClick> \} ], ;
                           <oWnd>:bRClicked [ := \{ |nRow,nCol,nKeyFlags| <uRClick> \} ], ;
                           <oWnd>:bMoved    [ := <{uMove}> ], ;
                           <oWnd>:bResized  [ := <{uResize}> ], ;
                           <oWnd>:bPainted  [ := <{uPaint}> ], ;
                           <oWnd>:bKeyDown  [ := \{ |nKey| <uKeyDown> \} ],;
                           <oWnd>:bInit     [ := \{ | Self | <uInit> \} ] )

#xcommand DEFINE BUTTONBAR [ <oBar> ] ;
             [ <wnd:OF,WINDOW> <oWnd> ] ;
      => ;
         <oWnd>:oBar := [ <oBar> := ] TBar():New( <oWnd> )

#xcommand DEFINE BUTTON [ <oBtn> ] ;
             [ <bar:OF,BUTTONBAR> <oBar> ] ;
             [ BITMAP <cBitmap> ] ;
             [ ACTION <uAction> ] ;
             [ <group:GROUP> ] ;
             [ MESSAGE <cMsg> ] ;
      => ;
         [ <oBtn> := ] <oBar>:Add( <cBitmap>, <cMsg>, <{uAction}>, <.group.> )
#endif
